<?php

use yii\db\Migration;

/**
 * Handles the creation of table `invoice`.
 */
class m161111_020823_create_invoice_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('invoice', [
            'id' => $this->primaryKey(),
            'oid' =>$this->integer(),
            'money'=> $this->string(),
            'title'=> $this->string(),
            'invoicesn'=> $this->string(),
            'invotetime'=> $this->integer(),
            'invotecate'=> $this->string(),
            'invoterecip'=> $this->string(),
            'invoteaddress'=> $this->string(),
            'invotecode'=> $this->string(),
            'invotephone'=> $this->string(),
            'invotewuliu'=> $this->string(),
            'invotewunum'=> $this->string(),
            'status' => $this->smallInteger()->notNull()->defaultValue(1),
            'created_at' => $this->integer()->notNull(),
            'updated_at' => $this->integer()->notNull(),     
        
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('invoice');
    }
}
